/*    */ package com.zimbra.cs.account.soap;
/*    */ 
/*    */ import com.zimbra.common.account.Key.ServerBy;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.soap.Element.XMLElement;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import com.zimbra.soap.admin.type.Attr;
/*    */ import com.zimbra.soap.admin.type.ServerInfo;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class SoapServer
/*    */   extends Server
/*    */   implements SoapEntry
/*    */ {
/*    */   SoapServer(String name, String id, Map<String, Object> attrs, Provisioning prov)
/*    */   {
/* 36 */     super(name, id, attrs, null, prov);
/*    */   }
/*    */   
/*    */   SoapServer(ServerInfo serverInfo, Provisioning prov) throws ServiceException {
/* 40 */     super(serverInfo.getName(), serverInfo.getId(), Attr.collectionToMap(serverInfo.getAttrList()), null, prov);
/*    */   }
/*    */   
/*    */   SoapServer(Element e, Provisioning prov) throws ServiceException
/*    */   {
/* 45 */     super(e.getAttribute("name"), e.getAttribute("id"), SoapProvisioning.getAttrs(e), null, prov);
/*    */   }
/*    */   
/*    */   public void modifyAttrs(SoapProvisioning prov, Map<String, ? extends Object> attrs, boolean checkImmutable) throws ServiceException {
/* 49 */     Element.XMLElement req = new Element.XMLElement(AdminConstants.MODIFY_SERVER_REQUEST);
/* 50 */     req.addElement("id").setText(getId());
/* 51 */     SoapProvisioning.addAttrElements(req, attrs);
/* 52 */     setAttrs(SoapProvisioning.getAttrs(prov.invoke(req).getElement("server")));
/*    */   }
/*    */   
/*    */   public void reload(SoapProvisioning prov) throws ServiceException {
/* 56 */     Element.XMLElement req = new Element.XMLElement(AdminConstants.GET_SERVER_REQUEST);
/* 57 */     Element a = req.addElement("server");
/* 58 */     a.setText(getId());
/* 59 */     a.addAttribute("by", Key.ServerBy.id.name());
/* 60 */     setAttrs(SoapProvisioning.getAttrs(prov.invoke(req).getElement("server")));
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/soap/SoapServer.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */